Conversation
Member
Author
|
This is intended to supersede #533 which was reverted to maintain compatibility with pre release versions |
7b52c03 to
d391e7e
Compare
Member
Author
|
Notes:
|
879dba6 to
eedecf8
Compare
notrepo05
commented
May 2, 2025
Member
Author
|
I ran git bisect and discovered that 3b4fd72 might be breaking the bake acceptance tests. I've reverted it for now in order to have a clean test foundation |
Member
Author
|
Tests pass otherwise, so reapplying with that known. That should be followed up on in a different PR :) |
mamachanko
approved these changes
May 6, 2025
Contributor
15a348f to
3741c49
Compare
for exact matches and proper pre-release version support.
0801978 to
a3b2c44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue description
This PR aims to fix
e.g.
bosh-releases/smoothie/9.9/mango/tgz-9.9mangosmoothie.9.9--andsome-release-1.2.3-notices.zipI'm especially hoping to get feedback because it's a breaking change for the Artifactory Release Source: pre-release versions will no longer be found by the default
⚠️ Instead the constraint
⚠️ It drops support for 4 segment versions like 1.2.3.4.
*release constraint.Breaking changes:
>0-0would be neededℹ️ the
vprefix is allowedℹ️ when stemcells are used
find-release-versionrequires a stemcell version to be setThe reason for requiring this breaking change is that the resource has been matching only major.minor.patch.fourth and incidentally picking up / ignoring the pre-release segment. But I’d like it to fully embrace pre-release support by swapping the major.minor.patch regex for one that captures both pre-release (1.2.3-pre.1) and build metadata (1.2.3+build.1). For example, we’ll no longer see the remote file
some-release-1.2.3-dev.1.tgzupdating the Kilnfile.lock to1.2.3, but rather1.2.3-dev.1. If we default '*' to include pre-releases then there isn't a clear way to exclude them.More details
Currently, the Artifactory Release Source is extracting versions matching the following the pattern
([-v])\d+(.\d+)*. The first match is assumed to be the bosh release and if a second exists it's the stemcell's version. The Kilnfile template is partially ignored and order takes precedent here. Also, since we only match on e.g.1.2.3and not1.2.3-build.1this implies there's no pre-release sorting beyond creation date from Artifactory to the best of my knowledge. Since the Kilnfile template isn't strictly enforced files you get the examples seen under "Downloading undesired / unrelated files" at the top of this comment.Proposal
File parsing
I'd like to propose
artifactory source'sfind-release-versionfully utilizes mastermind's semantics (used by otherkilnrelease sources)For example, among others, these templates have been tested:
release-version-beginning-path/{{.StemcellVersion}}/{{.Version}}/{{.Name}}/{{.Name}}.tgz<-- this would have failedrelease-version-in-path/{{.Name}}/{{.StemcellOS}}/{{.StemcellVersion}}/{{.Version}}/{{.Name}}.tgzThe flow is basically
turns into an AQL query
whose results are parsed by a regex version of the path template
to extract the version(s), check against mastermind's version constraint, and sort for latest.
Using AQL
AQL (Artifactory Query Language) supports searching for files using the path template globbing scheme described above. So this PR moves file searching responsibility to
jfrog-client-go. This also updates checksums without requiring downloadSemver semantics
Adopting mastermind's semantics changes the meaning of
*for theartifactory source'sfind-release-versionsince it won't match pre-releases, making this a breaking change. But it helps tiles avoid accidental ingestion of unwanted files.while still allowing pre-release matches by opting in with a constraint like>0-0.See https://github.com/Masterminds/semver?tab=readme-ov-file#working-with-prerelease-versions
Notes
1.2.3+build.1and1.2.3-rc.1will be supported.